package com.itheima.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.mapper.RoleMenuMapper;
import com.itheima.mapper.RoleUserMapper;
import com.itheima.pojo.RoleMenu;
import com.itheima.pojo.RoleUser;
import com.itheima.service.RoleMenuService;
import com.itheima.service.RoleUserService;
import org.apache.dubbo.config.annotation.Service;

/**
 * @author jshstart
 * @creat 2020-11-23 9:43
 */
@Service
public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> implements RoleMenuService {


    @Override
    public Long[] findMenuByRoleId(Long id) {
            return  this.baseMapper.findMenuByRoleId(id);
    }

    @Override
    public void deleteById(Long roleId) {
        QueryWrapper<RoleMenu> wrapper = new QueryWrapper<>();
        wrapper.eq("role_id",roleId);
        this.remove(wrapper);
    }
}
